<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link href="../img/base.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../img/jquery.js" ></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script language="javascript" src="../js/My97DatePicker/WdatePicker.js"></script>
<script language="javascript">
    function checkSubmit()
    {
      if(document.form1.admin_name.value == '')
      {
	       alert("请填写会员名称！");
	       return false;
      }  
    }   
</script>
</head>
<body leftmargin='15' topmargin='10' bgcolor="#FFFFFF">
   <form name="form1" action="user_act.php?action=save" enctype="multipart/form-data" method="post" onSubmit="return checkSubmit()">
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	    <td>&nbsp;</td>
	</tr>
    </table>

    <table width="97%" border="0" align="center" cellpadding="0" cellspacing="0" id="head1" style="border-bottom:1px solid #CCCCCC">
	<tr>
	    <td colspan="2">
		<table width="98%" border="0" cellpadding="0" cellspacing="0">
		    <tr>
			<td width="84" height="24" align="center" background="../img/itemnote1.gif">&nbsp;编辑会员&nbsp;</td>
			<td width="84"></td>
			<td>&nbsp;</td>
		    </tr>
		</table>
	    </td>
	</tr>
    </table>
    <table width="98%"  border="0" align="center" cellpadding="2" cellspacing="2" id="needset">
	<tr>
	    <td height="24" colspan="4" class="bline">
			<table width="98%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td class="bline" width="90">&nbsp;会员级别：</td>
					<td class="bline">							
						<select name="user_type_id" onchange="select_user_type(this.value)">
						   <option <{if $user_arr.user_type_id eq 0 }>selected="selected" <{/if}> value="0">普通会员</option>
						   <option <{if $user_arr.user_type_id eq 1 }>selected="selected" <{/if}> value="1">一级经销商会员</option>
						   <option <{if $user_arr.user_type_id eq 2 }>selected="selected" <{/if}> value="2">二级经销商会员</option>
						   <option <{if $user_arr.user_type_id eq 3 }>selected="selected" <{/if}> value="3">名企会员</option>
					   </select>
					</td>					
				</tr>

				<tr id="belong_user"  <{if $user_arr.user_type_id neq 2 }>style="display:none;"<{/if}> >
					<td class="bline" width="90">&nbsp;所属一级会员：</td>
					<td class="bline">
						<select name="pid">
						  <{foreach from=$user_list item=userarr}>
						      <option <{if $user_arr.pid eq $userarr.user_id }>selected="selected" <{/if}> value="<{$userarr.user_id}>"><{$userarr.user_name}></option>
						   <{/foreach}>
					   </select>
					</td>
				</tr>

			   <tr id="belong_company"  <{if $user_arr.user_type_id neq 3 }>style="display:none;"<{/if}> >
					<td class="bline" width="90">&nbsp;所属名企：</td>
					<td class="bline">
						<select name="company">
						  <{foreach from=$company_list item=company}>
						      <option <{if $user_arr.company eq $company.company_id }>selected="selected" <{/if}> value="<{$company.company_id}>"><{$company.company_name}></option>
						   <{/foreach}>
					   </select>
					</td>
				</tr>

				<tr>
					<td class="bline" width="90">&nbsp;会员名称：<input name="user_id" type="hidden" value="<{$user_arr.user_id}>"/></td>
					<td class="bline"><input name="user_name" type="text" value="<{$user_arr.user_name}>"  size="50" class="iptxt" /></td>
				
				</tr>
				<tr>
					<td class="bline" width="90">&nbsp;会员密码：</td>
					<td class="bline"><input name="pwd" type="password" value=""   size="50" class="iptxt" />(修改时不填表示密码不变)</td>
				</tr>
				<tr>
					<td class="bline" width="90">&nbsp;会员状态：</td>
					<td class="bline" colspan="2"> 						
						<input type="radio" name="user_status" <{if $user_arr.user_status eq 1}>checked<{/if}> value ="1">启用 &nbsp; 
						<input type="radio" name="user_status" <{if $user_arr.user_status eq 0}>checked<{/if}> value = "0">禁用	
					</td>				
				</tr>	
				<tr>
					<td class="bline" width="90">&nbsp;会员性别：</td>
					<td class="bline">
						<input type="radio" name="user_sex" <{if $user_arr.user_sex eq 1}>checked<{/if}>  value = "1">男 &nbsp; 
						<input type="radio" name="user_sex" <{if $user_arr.user_sex eq 0}>checked<{/if}> value = "0">女
					</td>
					
				</tr>	
			    <tr>
					<td class="bline" width="90">&nbsp;会员手机：</td>
					<td class="bline"><input name="user_phone" type="text" value="<{$user_arr.user_phone}>"  size="50" class="iptxt" /></td>
				
				</tr>	
				 <tr>
					<td class="bline" width="90">&nbsp;会员邮箱：</td>
					<td class="bline"><input name="user_email" type="text" value="<{$user_arr.user_email}>"  size="50" class="iptxt" /></td>					
				</tr>
				 <tr>
					<td class="bline" width="90">&nbsp;会员生日	：</td>
					<td class="bline"><input name="birthday" onclick="WdatePicker()" type="text" value="<{$user_arr.birthday|date_format:'%Y-%m-%d'}>"  size="50" class="iptxt" /></td>
				</tr>
				
				 <tr>
					<td class="bline" width="90">&nbsp;会员地址：</td>
					<td class="bline"><input  name="user_address" type="text" value="<{$user_arr.user_address}>"  size="50" class="iptxt" /></td>
				</tr>
			</table>
	    </td>				
	</tr>
    </table>
    <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
		<tr>
			<td height="56">
			<table width="98%" border="0" cellspacing="1" cellpadding="1">
				<tr>
				<td align="center">
					<table width="214" border="0" cellspacing="0" cellpadding="0" >
					<tr>
						<td width="115">
						<input name="imageField" type="image" src="../img/button_ok.gif" width="60" height="22" class="np" border="0"  style="cursor:pointer; ">
						</td>
						<td width="99">
						 <img src="../img/button_reset.gif" width="60" height="22" border="0" onClick="location.reload();" style="cursor:pointer; ">
						</td>
					</tr>
				   </table>
				</td>
				</tr>
			</table>
			</td>
		</tr>
    </table>
    </form>
</body>
</html>
<script type="text/javascript">

function select_user_type(val)
{
	if(val == 2)
	{
		$("#belong_user").show();
		$("#belong_company").val(0)
	}else
	{
		$("#belong_user").hide()
	}

	 if(val == 3){
		$("#belong_company").show();
		$("#belong_user").val(0)
	}else
	{
		$("#belong_company").hide()
	}
}

</script>
